feat: Add filter by UID feature by using existing --filter syntax - #3237
feat: Add filter by UID feature by using existing --filter syntax#3237filzrev wants to merge 1 commit into
Conversation
689470f to
24e30c5
Compare
adamsitnik
left a comment
There was a problem hiding this comment.
@filzrev I am trying to understand when filtering by guid is going to provide value.
Let's say that I have the BenchmarkDotNet.Tests.Filters.TypeWithBenchmarksAndParams.TheBenchmark benchmark and I want to run it.
If I use --filter BenchmarkDotNet.Tests.Filters.TypeWithBenchmarksAndParams.TheBenchmark it just works.
When I use UID I need to:
- write some code that is going to generate the unique ID using
GetUniqueId(not mentioned in samples or XML docs) - somehow store this value
- provide the value when filtering.
Now as soon as the namespace, type name, method name or any other part of the benchmark ID changes, the UID is no longer valid. So what is the advantage of using it over the typical --filter?
|
It's intended to be used for debugging purpose. ( Existing filter syntax match Example [InProcess]
[Config(typeof(DebugInProcessConfig))]
public class Benchmarks
{
[Benchmark]
public void Benchmark01() {}
}And when filtering benchmarkCase with To run specific benchmark for debugging purpose, |
Thanks. In such case I would expect the user to modify the config and just comment out the Job they don't want to use. |
I want to avoid modify/rebuild benchmark if possible. I want to run specific benchmark case(Job) by editing If reusing the |
This is a great goal and that is why we should encourage users to specify all the jobs arguments via command line arguments. My personal approach is to always have a config with the default settings I usually want (like 1 warmup iteration), with a single job marked But in this particular example we talk about Debugging, which requires and IDE (at least for most of us). So I would expect the users to simply go and modify the code by commenting out the job they don't like just a moment before they hit F5. |
This PR extend existing
--filtersyntax to support filter by UID of BenchmarkCase.By modyfing existing filter logics to use
UidFilterwhen filter text can be parsed as GUID format.Other changes
Filtersdirectory/namespace.